package com.zxhhyj.storm.dsl

import com.zxhhyj.storm.database.Database
import com.zxhhyj.storm.schema.Column
import com.zxhhyj.storm.schema.Table
import kotlin.reflect.KProperty0

typealias SelectBindingProperty<T> = KProperty0<Column<T, *>>

class FormBuilder<T, E : Table<T>> internal constructor(
    private val targetDatabase: Database,
    private val targetTable: E
) {

    fun select(vararg selectColumns: Column<T, *>): QueryBuilder<T, E> {
        if (selectColumns.isEmpty()) {
            return QueryBuilder(targetDatabase, targetTable, targetTable.columns)
        }
        return QueryBuilder(targetDatabase, targetTable, selectColumns.toList())
    }

    fun selectDistinct() {

    }

}